package com.xuyoupeng.springlearn.bean;


import com.xuyoupeng.springframework.beans.BeansException;
import com.xuyoupeng.springframework.beans.factory.*;
import com.xuyoupeng.springframework.context.ApplicationContext;
import com.xuyoupeng.springframework.context.ApplicationContextAware;
import com.xuyoupeng.springlearn.bean.dao.IUserDao;
import com.xuyoupeng.springlearn.bean.dao.UserDao;

public class UserService {

    private String name;

    private Integer age;

    private Character gender;

    private String userId;

    private IUserDao userDao;

    public void queryUserInfo() {
        queryUserNameByUserId();
    }

    public String queryUserNameByUserId() {
        return userDao.queryUserName(userId) + "," + age + "," + gender;
    }

    @Override
    public String toString() {
        final StringBuilder sbd = new StringBuilder();
        sbd.append(name);
        return sbd.toString();
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Character getGender() {
        return gender;
    }

    public void setGender(Character gender) {
        this.gender = gender;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public void setUserDao(IUserDao userDao) {
        this.userDao = userDao;
    }

    public IUserDao getUserDao() {
        return userDao;
    }
}
